package com.briup.ptt.service.Impl;

import com.briup.ptt.bean.Animal;
import com.briup.ptt.bean.ext.AnimalExt;
import com.briup.ptt.mapper.AnimalMapper;
import com.briup.ptt.mapper.ext.AnimalExtMapper;
import com.briup.ptt.service.AnimalService;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 杰瑞
 * @date 2025/8/18
 */
@Service
public class AnimalServiceImpl implements AnimalService {

    @Resource
    private AnimalMapper animalMapper;

    @Resource
    private AnimalExtMapper animalExtMapper;

    @Override
    public void saveOrUpdate(Animal animal) {
        animalMapper.insert(animal);
    }

    @Override
    public void deleteById(String id) {
        animalMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void deleteById(List<String> ids) {

        for (String id : ids) {
            animalMapper.deleteByPrimaryKey(id);
        }

    }

    @Override
    public PageInfo<AnimalExt> findByPage(Integer pageNum, int pageSize, String aHealthy, String aGender) {

        return null;
    }
}
